package com.danco.planner.essences.arraylists;

import java.util.ArrayList;

import com.danco.planner.essences.*;
import com.danco.planner.sortings.sortby.SortByName;

public class StudentsList extends ArrayList<Student> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	// In truth, I can not imagine why i need this ID
	
	public void sortByName() {
		this.sort(new SortByName());
	}
	
	@Override
	public String toString() {
		
		StringBuilder stb = new StringBuilder();
		for (Student student : this) {
			stb.append(student.toString() + "\n\t");
		}
		stb.deleteCharAt(stb.length()-1);
		return stb.toString();
	}
}
